package struct.composite;

import java.util.Enumeration;

/**
 * Created
 * 组合模式
 * by hmily on 2017/9/7.
 */
public class TestMain {

    public static void main(String[] args) {
        TreeNode root = new TreeNode("Root");
        TreeNode node1 = new TreeNode("child1");
        TreeNode node2 = new TreeNode("child2");
        TreeNode node3 = new TreeNode("node3");
        node1.add(node3);
        root.add(node1);
        root.add(node2);
        Enumeration<TreeNode> childs = root.getChilds();
    }
}
